<?php

require_once("../conn.php");
$result = true;
$db = new DBC();
if (isset($_GET['ids'])) {
    $ids = trim($_GET['ids']);    
    $array = explode(",", $ids);
    foreach ($array as $code) {
        if ($code != '') {
            $sql = "DELETE FROM t_hibaby_property WHERE code = '" . $code . "'";

            if ($db->execute($sql)) {
                //success
                //        echo "<script language='javascript'>alert('\u6210\u529f'); </ script>";
            } else {
                //failue
                $result = false;
            }
        }
    }
}

if (!$result) {
    echo "<script language='javascript'>alert('\u5931\u8d25'); </script>";
}
if (isset($_GET['page'])) {
    $page = $_GET['page'];
} else {
    $page = 0;
}
echo "<script language='javascript'>location='propertyList.php?menu=property&page=" . $page . "';</script>";
?>
